import { myLogger } from "../../logger/myLogger/mylogger.js"
import { IExcepHandler, EventCode } from "../eventHandler.js"


class ConnectKafkaErrorHandler implements IExcepHandler{
    handle(logger: myLogger, code: EventCode,info:string, err: Error): void {
        if (code==EventCode.FETCH_RAW_DATA_FAIL){
            logger.err(1,"connect to kafka error info :",info,err.name,err.message,err.stack as string)
            return
        }
        if (this.nextHandle!=null){
            this.nextHandle.handle(logger,code,info,err)
        }
    }
    nextHandle: IExcepHandler | null=null
}

export {ConnectKafkaErrorHandler}